import { Controller, Get, Query } from "@nestjs/common";
import { ApiTags } from "@nestjs/swagger";
import { CommonService } from "./common.service";
import { DataObj } from "src/common/class/data-obj.class";
import { ReqCodeKindDto } from "./dto/req-common.dto";

@ApiTags("类型查询")
@Controller("common")
export class CommonController {
  constructor(private readonly commonService: CommonService) {}

  /**
   * @description: 获取枚举类型
   * @return {*}
   */
  @Get("getCodeKinds")
  async getCodeKinds(@Query() reqCodeKindDto: ReqCodeKindDto) {
    const res = await this.commonService.getCodeKinds(reqCodeKindDto);
    return DataObj.create(res);
  }
}
